﻿package Naruto{
	import flash.display.Sprite;
	import flash.display.MovieClip;
	import flash.display.Stage;
	
	public class Naruto extends Sprite{
	
		private var _status:Status;
		private var _aNaruto:Naruto1;
		private var _meLevel:int;		//等级
		private var _health:Number;		//生命值
		private var direc:String;
				
		public function Naruto (_Status) {
			this._status = _Status;
			this._health = this._status.getHealth();
			_aNaruto = new Naruto1();
		}
		
		public function getme(){
			return this._aNaruto;
		}
		public function getposx(){
			return this._aNaruto.x;
		}
		public function getposy(){
			return this._aNaruto.y;
		}
		public function setpos(stage:Stage,posx:int,posy:int){
			this._aNaruto.x = posx;
			this._aNaruto.y = posy;
		}
		
		public function setLevel(level:int){
			this._meLevel = level;
		}
		
		public function changepos(direc){
			switch(direc){
				case "up":   this._aNaruto.y -= 10;break;
				case "down": this._aNaruto.y += 10;break;
				case "left": this._aNaruto.x -= 10;break;
				case "right":this._aNaruto.x += 10;break;
			}
		}
		
		public function hurtMe(blood,modulus){
			switch(modulus){
				case 1:{	//飞镖伤害
						this._health -= 10;
						//trace("Health:" + this.health);
						blood.changeHealth(this._health);
						break;}
				case 2:{	//技能伤害
						this._health -= 0.5;
						blood.changeHealth(this._health);
						}
				default:this._health -= 10*0.1;break;
			}
		}
	}	
}